SET.OPEN Function
Syntax
Arguments
- setname
The name of a set. The extension ".set" is assumed.
- file_open_mode|SQL
Optional. Determines the access privileges that apply to the open table file. You can use one of the following system variables:
- Variable
- Function
- FILE_RO_EXCLUSIVE
Read Only (Exclusive)
- FILE_RW_EXCLUSIVE
Read or Write (Exclusive)
- FILE_RO_SHARED
Read Only (Shared)
- FILE_RW_SHARED
Read or Write (Shared)
- encryption
Optional. Needed if the table has been encrypted, and the default encryption key has not been set (using the DEFAULT_ENCRYPTION_KEY_SET() function), of if the table was encrypted using a different encryption key than the default encryption key.
Description
Open a set - primary table of set becomes primary table of session. TIP: It is generally better to use set.open_session().
Discussion
SET.OPEN() opens a set and returns a pointer to the set. Returns the <Set> pointer variable that references the set. See TABLE.OPEN() for a description of the Open Mode and Password parameters.
Once the set has been opened, you can use the <Set> pointer variable to get pointers to the individual tables in the set. The syntax is:
<TBL> = <SET>.alias
where alias is the alias of the table in the set.
Example
From the Interactive window:
s = set.open("invoice") ? set.current().filename_get()-> "c:\program files\a5v5\samples\alphasports\invoice.SET" 'get a pointer to the invoice_header table t1 = s.invoice_header 'get a pointer to the customer table t2 = s.customer 'move to the last record in the invoice set t1.fetch_last() 'display the matching customer lastname for this invoice ? t2.lastname -> "Graham "
See Also